The simulation and correspondence between Horn clause and context-free grammar make the most efficient algorithm-the Earley Algorithm about context-free grammar applied to the implementation of logical programs. Horn子句和上下文无关方法的相似性、对应性,使上下文无关文法的最有效算法&Earley算法的思想,应用于逻辑程序的实现。